package com.reggie.common.enums;

import com.reggie.common.ResultResponseVo;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author 早睡蛋
 * @Date 2022/7/25 11:56:25
 * @Desc:
 * 通用枚举
 */
@Getter
@AllArgsConstructor
public enum PublicEnums {

    SUCCESS(200,"ok"),
    FAIL(400,"fail"),


    ;


    PublicEnums(int code, String message) {
        this.resultResponseVo =  ResultResponseVo.defaultResultResponse();
        resultResponseVo.setCode(code);
        resultResponseVo.setMessage(message);
    }

    public int getCode(){
        return resultResponseVo.getCode();
    }

    public String getMessage(){
        return resultResponseVo.getMessage();
    }

    public ResultResponseVo getResult() {
        return resultResponseVo;
    }


    private final ResultResponseVo resultResponseVo;

}
